home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Includes / graphics / screens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-14  |  7.9 KB  |  228 lines

  1. #ifndef GRAPHICS_SCREENS_H
  2. #define GRAPHICS_SCREENS_H TRUE
  3.  
  4. /*
  5. **  $VER: screens.h V0.9B
  6. **
  7. **  Screen Definitions
  8. **
  9. **  (C) Copyright 1996-1997 DreamWorld Productions.
  10. **      All Rights Reserved.
  11. */
  12.  
  13. #ifndef DPKERNEL_H
  14. #include <dpkernel/dpkernel.h>
  15. #endif
  16.  
  17. /****************************************************************************
  18. ** Screen Object.
  19. */
  20.  
  21. #define SCRVERSION  1
  22. #define TAGS_SCREEN ((ID_SPCTAGS<<16)|ID_SCREEN)
  23.  
  24. struct GScreen {
  25.   struct Head Head;       /* [00] Standard structure header */
  26.   APTR   MemPtr1;         /* [12] Ptr to screen 1 */
  27.   APTR   MemPtr2;         /* [16] Ptr to screen 2 (double buffer) */
  28.   APTR   MemPtr3;         /* [20] Ptr to screen 3 (triple buffer) */
  29.   struct GScreen *Next;   /* [24] Reserved */
  30.   LONG   *Palette;        /* [28] Ptr to the screen palette */
  31.   struct Raster *Raster;  /* [32] Ptr to a rasterlist */
  32.   LONG   empemp;          /* [36] */
  33.   WORD   Width;           /* [40] The width of the visible screen */
  34.   WORD   Height;          /* [42] The height of the visible screen */
  35.   WORD   XOffset;         /* [44] Hardware co-ordinate for TOS */
  36.   WORD   YOffset;         /* [46] Hardware co-ordinate for LOS */
  37.   WORD   BmpXOffset;      /* [48] Offset of the horizontal axis */
  38.   WORD   BmpYOffset;      /* [50] Offset of the vertical axis */
  39.   WORD   ScrMode;         /* [52] What screen mode is it? */
  40.   WORD   Empty;           /* [54] Reserved. */
  41.   LONG   Attrib;          /* [56] Special Attributes are? */
  42.   struct DPKTask *Task;   /* [60] R: Task that owns this screen */
  43.   struct Bitmap *Bitmap;  /* [64] Bitmap */
  44.   WORD   Switch;          /* [68] Set to switch the buffers */
  45.  
  46.   /* Private fields */
  47.  
  48.   WORD   prv;                  /* */
  49.   APTR   prvTypeEmulator;      /* Emulation */
  50.   APTR   prvMonitor;           /* Monitor driver */
  51.   APTR   prvEMemPtr1;          /* Chunky driver */
  52.   APTR   prvEMemPtr2;          /* Chunky driver */
  53.   APTR   prvEMemPtr3;          /* Chunky driver */
  54.   APTR   prvEFree1;            /* Chunky driver */
  55.   APTR   prvEFree2;            /* Chunky driver */
  56.   APTR   prvEFree3;            /* Chunky driver */
  57.   BYTE   prvColBits;           /* 0 = 12bit, 1 = 24bit */
  58.   BYTE   prvPad;               /* Unused */
  59.   LONG   prvShowKey;           /* Resource key if the screen is shown */
  60.   LONG   prvScratch;           /* Scratch address! */
  61.   struct ScreenPrefs *Prefs;   /* Screen preferences for this screen */
  62.   APTR   prvLineWait;          /* Line Wait till bitplanes start */
  63.   APTR   prvEnd;               /* Ptr to the copper's jump end */
  64.   WORD   prvBurstLevel;        /* FMode setting for bitplanes */
  65.   struct Control *prvControl;  /* BPLCON0 */
  66.   APTR   prvModulo;            /* The screen modulo */
  67.   APTR   prvScrPosition;       /* DIW's, DDF's, DIWHIGH */
  68.   APTR   prvStart;             /* Start of main copperlist */
  69.   APTR   prvSprites;           /* Pointer to the copper sprites */
  70.   APTR   prvColours;           /* Pointer to the copper colours */
  71.   WORD   prvAmtBankCols;       /* Amount of colours per bank (AGA) */
  72.   WORD   prvAmtBanks;          /* Amount of banks in total (AGA) */
  73.   WORD   prvHiLoOffset;        /* Offset between hi and lo bits (AGA) */
  74.   BYTE   *prvBitplanes1;       /* Ptr to copper bitplane loaders #1 */
  75.   BYTE   *prvBitplanes2;       /* Ptr to copper bitplane loaders #2 */
  76.   BYTE   *prvBitplanes3;       /* Ptr to copper bitplane loaders #3 */
  77.   LONG   prvColListJmp;        /* Offset to RasterList */
  78.   LONG   prvBmpXOffset;        /* X offset for scrolling */
  79.   LONG   prvBmpYOffset;        /* Y offset for scrolling */
  80.   WORD   prvScrollBWidth;      /* Set to 2 if scrolling */
  81.   APTR   prvMemPtr1;           /* Original screen mem start (1) */
  82.   APTR   prvMemPtr2;           /* Original screen mem start (2) */
  83.   APTR   prvMemPtr3;           /* Original screen mem start (3) */
  84.   WORD   prvBPLCON3;           /* BPLCON3 actual data (not a ptr) */
  85.   WORD   prvAmtFields;         /* Amount of PlayFields on screen */
  86.   WORD   prvFieldNum;          /* Number of this field */
  87.   WORD   prvScrLRWidth;        /* ScrWidth, in lo-resolution */
  88.   WORD   prvScrLRBWidth;       /* ScrByteWidth, in lo-resolution */
  89.   WORD   prvPicLRWidth;        /* PicWidth, in lo-resolution */
  90.   WORD   prvTOSX;              /* Top of screen X for this screen */
  91.   WORD   prvTOSY;              /* Top of screen Y for this screen */
  92.   APTR   prvCopperMem;         /* Pointer to original screen mem start */
  93.   struct Bitmap *prvBitmap;    /* Allocated bitmap */
  94.   WORD   prvBlitXOffset;       /* Offset to use for blitting (hard-scroll) */
  95.   LONG   *prvPalette;          /* Allocated palette */
  96. };
  97.  
  98. /* Screen Buffer names, these are asked for in the blitter functions */
  99.  
  100. #define BUFFER1  12
  101. #define BUFFER2  16
  102. #define BUFFER3  20
  103.  
  104. /* SCREEN ATTRIBUTES (Attrib) */
  105.  
  106. #define DBLBUFFER    0x00000001   /* For double buffering */
  107. #define TPLBUFFER    0x00000002   /* Triple buffering!! */
  108. #define PLAYFIELD    0x00000004   /* Set if it's part of a playfield */
  109. #define HSCROLL      0x00000008   /* Gotta set this to do scrolling */
  110. #define VSCROLL      0x00000010   /* For vertical scrolling */
  111. #define SPRITES      0x00000020   /* Set this if you want sprites */
  112. #define SBUFFER      0x00000040   /* Create a buffer for horiz scrolling */
  113. #define CENTRE       0x00000080   /* Centre the screen (sets XOffset/YOffset) */
  114. #define BLKBDR       0x00000100   /* Gives a blackborder on AGA machines */
  115. #define NOSCRBDR     0x00000200   /* For putting sprites in the border */
  116. #define BLANKPALETTE 0x00000400   /* For a blank (black) palette */
  117.  
  118. /* SCREEN TYPES (ScrType) */
  119.  
  120. #define INTERLEAVED  1          /* These are numbers, not bits */
  121. #define ILBM         1
  122. #define PLANAR       2
  123. #define CHUNKY8      3
  124. #define CHUNKY16     4
  125. #define TRUECOLOUR   5
  126.  
  127. /* SCREEN MODES (ScrMode) */
  128.  
  129. #define HIRES      0x0001       /* High resolution */
  130. #define SHIRES     0x0002       /* Super-High resolution */
  131. #define LACED      0x0004       /* Interlaced */
  132. #define LORES      0x0008       /* Low resolution (default) */
  133. #define EXTRAHB    0x0010       /* Extra Half-Brite */
  134. #define SLACED     0x0020       /* Super-Laced resolution */
  135. #define HAM        0x0040       /* For HAM mode */
  136.  
  137. /* Screen Attribute tags */
  138.  
  139. #define GSA_MemPtr1    (12|TAPTR)
  140. #define GSA_MemPtr2    (16|TAPTR)
  141. #define GSA_MemPtr3    (20|TAPTR)
  142. #define GSA_INext      (24|TAPTR)
  143. #define GSA_Palette    (28|TAPTR)
  144. #define GSA_Raster     (32|TAPTR)
  145. #define GSA_Width      (40|TWORD)
  146. #define GSA_Height     (42|TWORD)
  147. #define GSA_XOffset    (44|TWORD)
  148. #define GSA_YOffset    (46|TWORD)
  149. #define GSA_BmpXOffset (48|TWORD)
  150. #define GSA_BmpYOffset (50|TWORD)
  151. #define GSA_ScrMode    (52|TWORD)
  152. #define GSA_Attrib     (56|TLONG)
  153.  
  154. #define GSA_BitmapTags (64|TSTEPIN)
  155.  
  156. /****************************************************************************
  157. ** Raster object.
  158. */
  159.  
  160. #define RASVERSION 1
  161.  
  162. struct Raster {
  163.   struct Head Head;        /* Standard header */
  164.   struct RHead   *Command; /* Pointer to the first command */
  165.   struct GScreen *Screen;  /* Pointer to our Screen owner */
  166.   LONG   Flags;            /* Special flags */
  167.  
  168.   /*** Private fields ***/
  169.  
  170.   APTR   prvRasterMem;
  171. };
  172.  
  173. #define RSF_DISPLAYED 0x00000001   /* If the raster is currently on display */
  174.  
  175. /****************************************************************************
  176. ** Rasterlist command header format.
  177. */
  178.  
  179. struct RStats {
  180.   LONG  CopSize;
  181.   UWORD *CopPos;
  182. };
  183.  
  184. struct RHead {
  185.   WORD ID;
  186.   WORD Version;
  187.   struct RStats *Stats;
  188.   struct RHead *Prev;
  189.   struct RHead *Next;
  190. };
  191.  
  192. /****************************************************************************
  193. ** These are the raster command structures.
  194. */
  195.  
  196. #define ID_RASTWAIT       1
  197. #define ID_RASTFLOOD      2
  198. #define ID_RASTCOLOUR     3
  199. #define ID_RASTCOLOURLIST 4
  200. #define ID_RASTMIRROR     5
  201.  
  202. #define ID_RASTEND        6
  203.  
  204. struct RWait {
  205.   struct RHead Head;
  206.   WORD Line;
  207. };
  208.  
  209. struct RFlood {
  210.   struct RHead Head;
  211. };
  212.  
  213. struct RColour {
  214.   struct RHead Head;
  215.   LONG Colour;
  216.   LONG Value;
  217. };
  218.  
  219. struct RColourList {
  220.   struct RHead Head;
  221.   WORD YCoord;
  222.   WORD Skip;
  223.   LONG Colour;
  224.   LONG *Values;
  225. };
  226.  
  227. #endif /* GRAPHICS_SCREENS_H */
  228.